﻿namespace Sai.Core
{
	using System;
    using System.Linq;
	using System.Collections.Generic;
	using Sai.Core.Rules;

	public class TypeDifferenceWalkerFactory : IWalkTypeDifferencesFactory
	{
		private IRulePluginRepository repository;

		public TypeDifferenceWalkerFactory(IRulePluginRepository repo)
		{
			this.repository = repo;
		}

		public IWalkTypeDifferences Create()
		{
			IWalkTypeDifferences typeDifferenceWalker = new TypeDifferenceWalker();

			foreach (var rule in this.repository.TypeRules)
			{
				typeDifferenceWalker.Add(rule);
			}

			return typeDifferenceWalker;
		}
	}
}
